-
Notifications
You must be signed in to change notification settings - Fork 8k
tests: drivers: spi: extend error_cases test. #97275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
tests: drivers: spi: extend error_cases test. #97275
Conversation
a13b59a
to
0379236
Compare
Extend with no reconfiguration on every tranceive case. Signed-off-by: Bartlomiej Buczek <[email protected]>
0379236
to
37250eb
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think it says anywhere in the SPI API that this would be the behavior. Even if it is a de facto of many drivers. If you want to make this official, it needs to be documented.
Please let me know if it's not enough https://github.com/zephyrproject-rtos/zephyr/blob/main/include/zephyr/drivers/spi.h#L434, If not I will move this to nordic-specific area for now, this scenario just matched exisitng test suite pretty well for me. On the other hand frequency of 124999Hz is afaik not documented as invalid anywhere, but such case is present in already existing tests. |
This is a weird case of the API , where the API is not saying how things should be but has a warning about how things may be, so I don't know if it's right to be testing other behavior as an "error". Let's see what @tbursztyka and @teburd think about it |
on the plus side: at least we'll notice if this behavior changes during some rework and make sure that such a change is intentional (as it requires change in tests). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, missed this yesterday when I reviewed, this doesn't look right to me
/* change valid config frequency to invalid value */ | ||
spim_valid.config.frequency = 124999; | ||
|
||
/* make sure device is not reconfigured because conf structure pointer is the same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't quite look right to me, why would it not be reconfigured here? Each transceive should be viewed as unique, if you go changing the spi bus frequency between transceives this should be valid, not sure why this wouldn't change the frequency. That's highly confusing behavior.
We've gone through this sort of thing before, create the test with the desired/conforming behavior not the existing broken one. |
And this is broken behavior imho |
Extend with no reconfiguration on every tranceive case.